using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;

namespace InterfaceToPropertyGrid
{
    class Dimension3DConverter : ExpandableObjectConverter
    {

        public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
        {
            Dimension3D dims = value as Dimension3D;
            if (dims == null)
                return "No Dimension3D Object";
            else
            {
                string str = dims.Width.ToString("w={0.000}")+ ", ";
                str += dims.Height.ToString("h={0.000}") + ", ";
                str += dims.Depth.ToString("d={0.000}");
                
                return str;
            }
        }

        private void foo()
        {
            //this.ConvertToString
        }
    }
}
